home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
RMTC02.ARJ
/
READDEF.C
< prev
next >
Wrap
Text File
|
1992-04-06
|
818b
|
54 lines
#include <stdio.h>
#include <graphics.h>
void main()
{
FILE *F;
int driver = EGA;
int mode = EGAHI;
int x, y, xoffset, yoffset;
int col, ch;
if ((F=fopen("rm.def","r")) == NULL)
{
printf("Can't open file!\n");
exit(0);
}
initgraph(&driver,&mode,"");
setfillstyle(SOLID_FILL,BLUE);
bar(0,0,639,349);
x=260;
y=120;
xoffset=0;
yoffset=0;
while (!feof(F))
{
ch=fgetc(F);
if (ch=='\n')
{
xoffset=0;
yoffset++;
}
else
{
if (ch>47 && ch<58)
{
col=ch-48;
putpixel(x+xoffset,y+yoffset,col);
}
else if (ch>64 && ch<71)
{
col=ch-55;
putpixel(x+xoffset,y+yoffset,col);
}
xoffset++;
}
}
fclose(F);
getch();
closegraph();
}